import React from "react";
import PropTypes from "prop-types";

export default class IgnoreCaseCheckbox extends React.Component {
  static get propTypes() {
    return {
      field: PropTypes.string,
      operator: PropTypes.string,
      value: PropTypes.bool,
      handleOnChange: PropTypes.func,
    };
  }

  constructor(props) {
    super(props);
  }

  render() {
    const { label, className, value, handleOnChange } = this.props;
    const checked = value === true;
    return (
      <label className={className}>
        <input
          type="checkbox"
          checked={checked}
          onChange={(e) => handleOnChange(e.target.checked)}
        />
        {label}
      </label>
    );
  }
}
